import {createRouter, createWebHashHistory} from 'vue-router';

const routes = [
    {
        path: '/',
        redirect: '/home'
    },
    {
        path: '/home',
        name: 'home',
        component: () => import( "@/views/home/Home"),
        meta: {
            index: 1
        }
    },
    {
        path: '/login',
        name: 'login',
        component: () => import('@/views/user/Login'),
        meta: {
            index: 1
        }
    },
    {
        path: '/user',
        name: 'user',
        component: () => import('@/views/user/User'),
        meta: {
            index: 1
        }
    },
    {
        path: '/setting',
        name: 'setting',
        component: () => import('@/views/user/Setting'),
        meta: {
            index: 2
        }
    },
    {
        path: '/address',
        name: 'address',
        component: () => import('@/views/user/address/Address'),
        meta: {
            index: 2
        }
    },
    {
        path: '/address-edit',
        name: 'address-edit',
        component: () => import('@/views/user/address/AddressEdit'),
        meta: {
            index: 3
        }
    },
    {
        path: '/search',
        name: 'search',
        component: () => import('@/views/good/Search'),
        meta: {
            index: 2
        }
    },
    {
        path: '/product',
        name: 'product',
        component: () => import('@/views/good/ProductDetail'),
        meta: {
            index: 3
        }
    },
    {
        path: '/good',
        name: 'good',
        component: () => import('@/views/user/good/Good'),
        meta: {
            index: 2
        }
    },
    {
        path: '/good-edit',
        name: 'good-edit',
        component: () => import('@/views/user/good/GoodEdit'),
        meta: {
            index: 3
        }
    },
    {
        path: '/activity-edit',
        name: 'activity-edit',
        component: () => import('@/views/user/good/ActivityEdit'),
        meta: {
            index: 3
        }
    },
    {
        path: '/create-order',
        name: 'create-order',
        component: () => import('@/views/order/CreateOrder'),
        meta: {
            index: 2
        }
    },
    {
        path: '/order',
        name: 'order',
        component: () => import('@/views/order/Order'),
        meta: {
            index: 2
        }
    },
    {
        path: '/order-detail',
        name: 'order-detail',
        component: () => import('@/views/order/OrderDetail'),
        meta: {
            index: 3
        }
    },
]

const router = createRouter({
    history: createWebHashHistory(),
    routes
})

export default router;